---
title: 召回模式
version: 'English'
---

当用户构建知识库问答类的 AI 应用时，如果在应用内关联了多个知识库，此时需要应用 Dify 的召回策略决定从哪些知识库中检索内容。

<Frame title="召回模式设置">
  <img src="/zh-hans/user-guide/.gitbook/assets/zh-rag-multiple.png" alt="" />
</Frame>

### 召回设置

根据用户意图同时匹配所有知识库，从多路知识库查询相关文本片段，经过重排序步骤，从多路查询结果中选择匹配用户问题的最佳结果，需配置 Rerank 模型 API。在多路召回模式下，检索器会在所有与应用关联的知识库中去检索与用户问题相关的文本内容，并将多路召回的相关文档结果合并，并通过 Rerank 模型对检索召回的文档进行语义重排序。

在多路召回模式下，建议配置 Rerank 模型。你可以阅读 [重排序](/zh-hans/user-guide/knowledge-base/indexing-and-retrieval/rerank) 了解更多。

以下是多路召回模式的技术流程图：

<Frame title="多路召回">
  <img src="/zh-hans/user-guide/.gitbook/assets/image (134).png" alt="" />
</Frame>

由于多路召回模式不依赖于模型的推理能力或知识库描述，该模式在多知识库检索时能够获得质量更高的召回效果，除此之外加入 Rerank 步骤也能有效改进文档召回效果。因此，当创建的知识库问答应用关联了多个知识库时，我们更推荐将召回模式配置为多路召回。

{/*
Contributing Section
DO NOT edit this section!
It will be automatically generated by the script.
*/}

<CardGroup cols="2">
    <Card
        title="Edit this page"
        icon="pen-to-square"
        href="https://github.com/langgenius/dify-docs-mintlify/edit/main/en/guides/knowledge-base/indexing-and-retrieval/retrieval.mdx"
    >
        Help improve our documentation by contributing directly
    </Card>
    <Card
        title="Report an issue"
        icon="github"
        href="https://github.com/langgenius/dify-docs-mintlify/issues/new?title=Documentation%20Issue%3A%20e&body=%23%23%20Issue%20Description%0A%3C%21--%20Please%20briefly%20describe%20the%20issue%20you%20found%20--%3E%0A%0A%23%23%20Page%20Link%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs-mintlify%2Fblob%2Fmain%2Fen/guides/knowledge-base/indexing-and-retrieval%2Fretrieval.mdx%0A%0A%23%23%20Suggested%20Changes%0A%3C%21--%20If%20you%20have%20specific%20suggestions%20for%20changes%2C%20please%20describe%20them%20here%20--%3E%0A%0A%3C%21--%20Thank%20you%20for%20helping%20improve%20our%20documentation%21%20--%3E"
    >
        Found an error or have suggestions? Let us know
    </Card>
</CardGroup>
